combobox—Remove useless button-press-event handler
authorDaniel Boles <dboles@src.gnome.org>
Thu, 16 Feb 2017 20:36:36 +0000 (20:36 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Thu, 16 Feb 2017 21:09:55 +0000 (21:09 +0000)
We use toggled, which does everything we need; this adds nothing useful.

Credit to Timm for noticing this—I didn’t when moving it to the ui file.

gtk/gtkcombobox.c
gtk/ui/gtkcombobox.ui

index 8b67b39b2ae66b1079120c3a1b92e3dc36fd0aac..3bb5d8c4dd84491916294fa913c984bcebb69b28 100644 (file)
@@ -286,9 +286,6 @@ static void     gtk_combo_box_model_row_changed    (GtkTreeModel     *model,
                                                     GtkTreeIter      *iter,
                                                     gpointer          data);
 
-static gboolean gtk_combo_box_menu_button_press    (GtkWidget        *widget,
-                                                    GdkEventButton   *event,
-                                                    gpointer          user_data);
 static void     gtk_combo_box_menu_activate        (GtkWidget        *menu,
                                                     const gchar      *path,
                                                     GtkComboBox      *combo_box);
@@ -971,7 +968,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
   gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, area);
   gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, popup_widget);
   gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_button_toggled);
-  gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_button_press);
   gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_activate);
   gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_key_press);
   gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_show);
@@ -1977,28 +1973,6 @@ gtk_combo_box_scroll_event (GtkWidget          *widget,
 }
 
 /* callbacks */
-static gboolean
-gtk_combo_box_menu_button_press (GtkWidget      *widget,
-                                 GdkEventButton *event,
-                                 gpointer        user_data)
-{
-  GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
-  GtkComboBoxPrivate *priv = combo_box->priv;
-
-  if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY)
-    {
-      if (gtk_widget_get_focus_on_click (GTK_WIDGET (combo_box)) &&
-          !gtk_widget_has_focus (priv->button))
-        gtk_widget_grab_focus (priv->button);
-
-      gtk_combo_box_menu_popup (combo_box, (const GdkEvent *) event);
-
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
 static void
 gtk_combo_box_menu_activate (GtkWidget   *menu,
                              const gchar *path,
index a3126c8de6ee7db39b6e636dd1646fadcd4198e6..09f7e4ea62ec1471e63c8175bb365b358a069a3b 100644 (file)
@@ -22,7 +22,6 @@
                 </child>
               </object>
             </child>
-            <signal name="button-press-event" handler="gtk_combo_box_menu_button_press" swapped="no" />
           </object>
           <packing>
             <property name="pack-type">end</property>